Hi
Ive tried a few different ways to check the weapon model a player is using , most seem to work when im by myself on the server , but stop working when people join, and all leave the same error
The error shows up randomly aswell , i can go and change weapons a dozen times , and the mod will be working , ie takes disallowed weapons, leaves allowed ones alone , and the error might show up about 2 times out of the 12 , at random points , and when people are in the server , it just fills the logs and stops working
local.player.weapon = $("arma" + local.nvezes).model (global/custom/weapons.scr, 108)
local.player.weapon = $("arma" + local.nvezes)^
^~^~^ Script Error: Field 'model' applied to NULL listener
Different Ways ive tried include
Code:local.ran = randomint 9999 self weaponcommand dual targetname ("weapon" + local.ran) local.player.weapon = $("weapon" + local.ran).modelCode:local.weapon = $player[1] getactiveweap 0 local.player.weapon = (local.weapon).modelCode:self weaponcommand dual targetname ("weapon" + local.ran) local.player.weapon = $("weapon" + local.ran).modelTried all of the above with same error , but all work to an extent that when im testing on server alone there fine but show error , when others are on it doesnt work at allCode:local.player weaponcommand duel targetname $("weap" + local.player.entnum ) local.player.weapon = $("weap" + local.player.entnum ).model
Tried executing from player spawn ( tried both reborns event and state file ) with a wait 1 to give player time to get weapon ( mainly for getactive weapon one )
or from the Raised weapons state in the mike.torso.
Also another question if i exec from the state file , is it global or will local.player work ? bit lost if it does or not
The above methods were taken from weapon mods , including admin pro , but all seem to give the Script error ,..
What am i doing wrong ??
This is the final problem of my weapon mod and its annoying me



Reply With Quote

That's why self is the player in scripts executed from the statefile. If the script is executed at state STAND for example, then this can mean three things: